22/57

# hdfs.ls

Lists the names of all HDFS directories containing data in the specified path.

Usage

    hdfs.ls(dfs.path)

Arguments

dfs.path

  A path relative to the current default path. The default path is the current working directory.

Return Value

A list of data object names in HDFS, or `NULL` if the specified path is invalid

See Also

`hdfs.cd`

Example

This example lists the subdirectories in the current directory:

    R> hdfs.ls()
    [1] "ontime_DB"   "ontime_FILE"   "ontime_R"

The next example lists directories in the parent directory:

    R> hdfs.ls("..")
    [1] "demo"   "input"   "output"   "sample"   "xq"

This example returns `NULL` because the specified path is not in HDFS.

    R> hdfs.ls("/bin")
    NULL